//
//  ViewController.m
//  LeanCloudDemo
//
//  Created by xalo on 16/4/22.
//  Copyright © 2016年 陈荣昌. All rights reserved.
//

#import "ViewController.h"
#import <AVOSCloud.h>

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.navigationItem.title = @"标题";
    
    

//    [self.navigationController.navigationBar setBackgroundImage:[[UIImage alloc] init] forBarMetrics:UIBarMetricsDefault];
    
    //隐藏NavigationBar
//    self.navigationController.navigationBar.shadowImage = [[UIImage alloc] init];
    
    
    
    
    // Do any additional setup after loading the view, typically from a nib.
}

-(void)registerAction{

    AVUser *user = [AVUser user];// 新建 AVUser 对象实例
    user.username = @"Tom";// 设置用户名
    user.password =  @"cat!@#123";// 设置密码
    user.email = @"tom@leancloud.cn";// 设置邮箱
    
    [user signUpInBackgroundWithBlock:^(BOOL succeeded, NSError *error) {
        if (succeeded) {
            // 注册成功
        } else {
            // 失败的原因可能有多种，常见的是用户名已经存在。
        }
    }];
}

-(void)loginAction{

//    用户名密码登录
    [AVUser logInWithUsernameInBackground:@"Tom" password:@"cat!@#123" block:^(AVUser *user, NSError *error) {
        if (user != nil) {
            
        } else {
            
        }
    }];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
